# plot immigration attitudes in ESS wave 10
bydate10 <- ESS10 %>%
  group_by(date) %>%
  filter(n()>9) %>%
  summarize(mig1 = mean(mig, na.rm = TRUE),
            eco1 = mean(eco, na.rm = TRUE),
            cul1 = mean(cul, na.rm = TRUE)) %>%
  ungroup()

desc1 <- ggplot(bydate10, aes(x = date, y = cul1)) + 
  geom_line(size = 1.5, color = "slateblue4") +
  ylim(2.5,7.5) +
  xlim(-100,100) +
  xlab("Days") +
  ylab("Culture") +
  theme_light(base_size = 40) +
  geom_vline(xintercept = 0, color = "black", linetype = "dashed", size = 1) 

desc2 <- ggplot(bydate10, aes(x = date, y = eco1)) + 
  geom_line(size = 1.5, color = "slateblue4") +
  ylim(2.5,7.5) +
  xlim(-100,100) +
  xlab("Days") +
  ylab("Economy") +
  theme_light(base_size = 40) +
  geom_vline(xintercept = 0, color = "black", linetype = "dashed", size = 1)

desc3 <- ggplot(bydate10, aes(x = date, y = mig1)) + 
  geom_line(size = 1.5, color = "slateblue4") +
  ylim(2.5,7.5) +
  xlim(-100,100) +
  xlab("Days") +
  ylab("Overall") +
  theme_light(base_size = 40) +
  geom_vline(xintercept = 0, color = "black", linetype = "dashed", size = 1)

ggarrange(desc3, desc2, desc1, nrow = 1)
